<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h3>发布微博页面</h3>
<form action="#" enctype="multipart/form-data">
    <input type="text" name="content" placeholder="说点儿什么...">
    <input type="file" name="file">
    <input type="button" value="发布" @click="send()">
</form>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<!--引入axios框架-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script>
    let vm = new Vue({
        el:"form",
        data:{},
        methods:{
            send:function () {
                let data = new FormData(document.querySelector("form"));
                axios.post("/send",data).then(function (response) {
                    alert("发布完成!");
                    location.href="/index.html";//回到首页
                })
            }
        }
    })
</script>
</body>
</html>